package com.matt.repository;

import com.matt.domain.ChildrenExtendInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;
import java.util.Date;
import java.util.List;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2017/8/31
 * *******************************
 */
public interface ChildrenExtendInfoRepository extends JpaRepository<ChildrenExtendInfo, String> {

    ChildrenExtendInfo findByChildrenId(String childrenId);

    @Query("update ChildrenExtendInfo set checkStatus=?1 , healthyStatus=?2, checkTime=?3, sickName=?4")
    @Modifying
    void updateCheckStatusAndHealthyStatusAndCheckTimeAndSickName(Integer checkStatus, Integer healthyStatus, Date checkTime, String sickName);

    List<ChildrenExtendInfo> findByChildrenIdIn(List<String> childrenIdList);

}
